package util;

import java.text.DecimalFormat;
import java.text.NumberFormat;

public class TimeUtil {

	static NumberFormat timeFormatter = new DecimalFormat("#.###");

	public static String getAvgTimeInSeconds(long startTimeInMs,
			long endTimeInMs, int divideBy) {
		return timeFormatter.format(((endTimeInMs - startTimeInMs) / 1000.0f)
				/ divideBy);
	}

	public static String getAvgTimeInMs(long startTimeInMs, long endTimeInMs,
			int divideBy) {
		return timeFormatter.format(((double)endTimeInMs - startTimeInMs) / divideBy);
	}
}
